/* 文字转语音组件样式 */
.text-to-speech {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  max-width: 500px;
  margin: 0 auto;
}

/* 文本输入区域 */
.tts-input-container {
  margin-bottom: 16px;
}

.tts-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: all 0.3s ease;
}

.tts-textarea:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
  background: rgba(255, 255, 255, 0.15);
}

.tts-textarea::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* 控制按钮区域 */
.tts-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  justify-content: center;
}

.tts-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  backdrop-filter: blur(10px);
}

.tts-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tts-btn:active {
  transform: translateY(0);
}

.tts-btn.speaking {
  background: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  animation: pulse 1.5s infinite;
}

.tts-btn.paused {
  background: rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

.tts-btn.settings-btn {
  background: rgba(34, 197, 94, 0.3);
  color: #86efac;
}

/* 脉冲动画 */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* 语音设置面板 */
.tts-settings {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.tts-settings h4 {
  margin: 0 0 16px 0;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.setting-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: #ffffff;
  font-size: 14px;
}

.setting-item:last-child {
  margin-bottom: 0;
}

.setting-item label {
  min-width: 50px;
  font-weight: 500;
}

.setting-slider {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.setting-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: #667eea;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.setting-slider::-webkit-slider-thumb:hover {
  background: #5a67d8;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.setting-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #667eea;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.setting-slider::-moz-range-thumb:hover {
  background: #5a67d8;
  transform: scale(1.1);
}

.setting-item span:last-child {
  min-width: 40px;
  text-align: right;
  font-weight: 500;
  color: #86efac;
}

.setting-select {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #ffffff;
  font-size: 14px;
  padding: 8px 12px;
  outline: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.setting-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.setting-select option {
  background: #1a1a2e;
  color: #ffffff;
  padding: 8px;
}

/* 状态指示器 */
.tts-status {
  margin-top: 12px;
  text-align: center;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: blink 1.5s infinite;
}

.status-text {
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0.3;
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .text-to-speech {
    padding: 16px;
    margin: 0 16px;
  }
  
  .tts-controls {
    gap: 8px;
  }
  
  .tts-btn {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }
  
  .setting-item {
    font-size: 13px;
  }
  
  .setting-item label {
    min-width: 45px;
  }
  
  .setting-item span:last-child {
    min-width: 35px;
  }
}

@media (max-width: 480px) {
  .text-to-speech {
    padding: 12px;
  }
  
  .tts-textarea {
    min-height: 100px;
    font-size: 13px;
  }
  
  .tts-controls {
    gap: 6px;
  }
  
  .tts-btn {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
  
  .setting-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .setting-item label {
    min-width: auto;
  }
  
  .setting-item span:last-child {
    min-width: auto;
    text-align: left;
  }
}

/* 深色主题适配 */
@media (prefers-color-scheme: dark) {
  .text-to-speech {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  .tts-btn,
  .setting-slider::-webkit-slider-thumb,
  .status-dot {
    animation: none;
  }
  
  .tts-btn:hover {
    transform: none;
  }
} 